-- GENERATED SPELL FOR [Lord Maldazzar] --


function spell0_1848(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(17173,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_1848', 5000, 1)
end

function spell1_1848(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12471,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1848', 3000, 1)
end

function spell2_1848(pUnit, Event) --@Summon Skeleton,Self--
pUnit:FullCastSpellOnTarget(17204,pUnit)
pUnit:RegisterEvent('Sorts_1848', 2000, 1)
end

function Sorts_1848(pUnit, Event)
local choix_sorts_1848 = math.random(0, 2)
if choix_sorts_1848 == 0 then
pUnit:RegisterEvent('spell0_1848', 1, 1)
end
if choix_sorts_1848 == 1 then
pUnit:RegisterEvent('spell1_1848', 1, 1)
end
if choix_sorts_1848 == 2 then
pUnit:RegisterEvent('spell2_1848', 1, 1)
end
end

function mob1848_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1848', math.random(1500, 3000), 1)
end

function mob1848_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1848_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1848_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1848, 1, 'mob1848_Action')
RegisterUnitEvent(1848, 2, 'mob1848_Leave')
RegisterUnitEvent(1848, 3, 'mob1848_Kill')
RegisterUnitEvent(1848, 4, 'mob1848_Die')
